/*
 * Copyright (c) 2021
 * User:mallplus多商户商城
 * File:WebMvcConfig.java
 * Date:2021/01/12 19:29:12
 */

package com.qyine.rlmall.config;


import com.qyine.rlmall.pay.interceptor.WxPayInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;


/**
 * The class Mdc web mvc config.
 *
 * @author 951449465 @gmail.com
 */
@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("swagger-ui.html")
                .addResourceLocations("classpath:/META-INF/resources/");

        registry.addResourceHandler("/webjars/**")
                .addResourceLocations("classpath:/META-INF/resources/webjars/");
    }

    @Bean
    public HandlerInterceptor getMyInterceptor() {
        return new WxPayInterceptor();
    }
}
